﻿<UserControl x:Class="Jok.Client.Portal.Views.AuthorizationView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:my="clr-namespace:Jok.Client.Portal.Views"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions"
    xmlns:inf_conv="clr-namespace:Jok.Infrastructure.Converters;assembly=Jok.Infrastructure"
    mc:Ignorable="d"
    d:DesignHeight="387" d:DesignWidth="538" >

    <UserControl.Resources>
        <inf_conv:NotOperatorValueConverter x:Key="NotOperatorValueConverter" />
        <Storyboard x:Name="sbGotoLogin" >
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoginBorder" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="-90"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.4000000" Value="-90"/>
                <EasingDoubleKeyFrame KeyTime="00:00:01" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="RegistrationBorder" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.4000000" Value="90"/>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="registrationView" Storyboard.TargetProperty="(Control.IsEnabled)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <System:Boolean>False</System:Boolean>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="loginView" Storyboard.TargetProperty="(Control.IsEnabled)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <System:Boolean>True</System:Boolean>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="sbGotoRegistration">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoginBorder" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.4000000" Value="-90"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="RegistrationBorder" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00.4000000" Value="90"/>
                <EasingDoubleKeyFrame KeyTime="00:00:01" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="loginView" Storyboard.TargetProperty="(Control.IsEnabled)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <System:Boolean>False</System:Boolean>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="registrationView" Storyboard.TargetProperty="(Control.IsEnabled)">
                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                    <DiscreteObjectKeyFrame.Value>
                        <System:Boolean>True</System:Boolean>
                    </DiscreteObjectKeyFrame.Value>
                </DiscreteObjectKeyFrame>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="#FF554E4E">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="RegistrationClick" SourceName="loginView">
                <im:ControlStoryboardAction Storyboard="{StaticResource sbGotoRegistration}"/>
            </i:EventTrigger>
            <i:EventTrigger EventName="LoginClick" SourceName="registrationView">
                <im:ControlStoryboardAction Storyboard="{StaticResource sbGotoLogin}"/>
            </i:EventTrigger>
        </i:Interaction.Triggers>

        <Border x:Name="LoginBorder" Height="427" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="264" BorderThickness="1" CornerRadius="3">
            <Border.Projection>
                <PlaneProjection/>
            </Border.Projection>
            <my:LoginView x:Name="loginView" />
        </Border>
        <Border x:Name="RegistrationBorder" Margin="52,23,52,22" BorderThickness="1" CornerRadius="3" Height="427" Width="264">
            <Border.Projection>
                <PlaneProjection RotationY="90"/>
            </Border.Projection>
            <my:RegistrationView x:Name="registrationView" />
        </Border>
    </Grid>
</UserControl>
